﻿using SelfMadeMillionaire.Core;
using SelfMadeMillionaire.Core.Entities;
using SelfMadeMillionaire.Core.Enums;
using SelfMadeMillionaire.Core.Repositories;
using SelfMadeMillionaire.Core.Services;
using SelfMadeMillionaire.Core.Specifications;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SelfMadeMillionaire.BLL.Services
{
	public class NewsletterProductService : INewsletterProductService
	{
		private readonly INewsletterProductRepository _NewsletterProductRepository;

        public NewsletterProductService(INewsletterProductRepository NewsletterProductRepository)
		{
            _NewsletterProductRepository = NewsletterProductRepository;
		}

        public IEnumerable<NewsletterProduct> GetByNewsletter(int id)
        {
            return _NewsletterProductRepository.GetAll(x => x.Newsletter.ID == id);
        }

		public void Remove(int id)
		{
            _NewsletterProductRepository.Remove(id);
		}

		
	}
}
